package com.gohi.main.store.hbm.jdbcMapper;



import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.gohi.main.store.hbm.ShopgooStore;
import com.gohi.main.store.hbm.ShopgooStoreClass;
import com.gohi.main.util.global.GloblConfig;
/**
 * 商户分类 信息读取
 * @author Administrator
 *
 */
public class StoreMapper implements RowMapper  {

	@Override
	public Object mapRow(ResultSet rs, int arg1) throws SQLException {
		// TODO Auto-generated method stub
		ShopgooStore s =new ShopgooStore();
		s.setComment_count(rs.getInt("comment_count"));//评论数量
		s.setTelephone(rs.getString("telephone"));//联系电话
		s.setAddress(rs.getString("address"));//地址
		s.setStore_name(rs.getString("store_name"));
		s.setPic(rs.getString("pic"));//轮播图片 逗号隔开
		s.setBeautician_count(rs.getInt("counts"));//技师总数
		s.setTemai_flag(rs.getInt("temai_flag"));//特卖标志信息
		s.setStore_id(rs.getInt("store_id"));
		String sp []= s.getPic().split(",");
		s.setBusiness_endtime(rs.getInt("business_endtime"));
		s.setBusiness_starttime(rs.getInt("business_starttime"));
		if(sp.length>1){
			for(String pic : sp ){
				if(!pic.trim().equals("")){
					//System.err.println(pic);
					s.getPiclist().add(GloblConfig.IMG_STORE+ pic.replace("_small.jpg", ""));
					
				}
			
			}
		}else{
			s.getPiclist().add(GloblConfig.IMG_STORE+  s.getPic().replace("_small.jpg", ""));
			s.getPiclist().add(GloblConfig.IMG_STORE+  s.getPic().replace("_small.jpg", ""));
		}
		s.setDescription(rs.getString("description"));//描述信息
		return s;
	}




	
}
